class LocalCache {
    // 设置 
   setCache(key:string,value:any){
       window.localStorage.setItem(key,JSON.stringify(value))
   }
   //  获取
   getCache(key:string){
       const value =window.localStorage.getItem(key)
       if(value){
           return JSON.parse(value)
       }
   }    

   deleteCache(key:string){
       window.localStorage.removeItem(key)
   }

   clearCache(){
        window.localStorage.clear()
   }
}

export default new LocalCache()